package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 * @author hua
 * @since 2024-10-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_lc_channel_rule")
@NoArgsConstructor
public class LcChannelRuleDo extends Model<LcChannelRuleDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 计算属性
     */
    @TableField("calculate_type")
    private Integer calculateType;

    /**
     * 操作方式 大于 小于
     */
    @TableField("operate_sign")
    private Integer operateSign;

    @TableField("start_value")
    private Float startValue;

    @TableField("end_value")
    private Float endValue;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    /**
     * 0 并且 1或者
     */
    @TableField("rule_relation")
    private Integer ruleRelation;

    @TableField("status")
    private Integer status;

    @TableField("channel_id")
    private Long channelId;

    @TableField("create_time")
    private Date createTime;

    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;


    @TableField("update_time")
    private Date updateTime;

    @TableField("update_by")
    private Long updateBy;


    @TableField("delete_time")
    private Date deleteTime;

    @TableField("delete_by")
    private Long deleteBy;

    public LcChannelRuleDo(Integer calculateType, Integer operateSign, Float startValue, Float endValue, Integer ruleRelation, Long channelId) {
        this.calculateType = calculateType;
        this.operateSign = operateSign;
        this.startValue = startValue;
        this.endValue = endValue;
        this.ruleRelation = ruleRelation;
        this.channelId = channelId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
